package com.jltx.xq.relaxnewspro.fragment;

import android.os.Bundle;
import android.support.v4.app.Fragment;

import com.jltx.xq.relaxnewspro.R;
import com.jltx.xq.relaxnewspro.adapter.PagerAdapter;
import com.jltx.xq.relaxnewspro.api.ScienceApi;

/**
 * Created by bo on 2017/4/9.
 */

public class BaseScienceFragment extends AbsTopNavigationFragment {
    private PagerAdapter pagerAdapter;
    protected PagerAdapter initPagerAdapter() {
        pagerAdapter = new PagerAdapter(getChildFragmentManager(), ScienceApi.channel_title) {

            @Override
            public Fragment getItem(int position) {
                ScienceFragment fragment = new ScienceFragment();
                Bundle bundle = new Bundle();
                bundle.putInt(getString(R.string.id_pos),position);
                bundle.putSerializable(getString(R.string.id_category),ScienceApi.channel_tag[position]);
                fragment.setArguments(bundle);
                return fragment;
            }
        };
        return pagerAdapter;
    }

}
